#include<iostream>
using namespace std;

int arr[10];
void printf_one_result(int n)
{
  for(int i = 0; i <= n; i++){
    if(i) cout << " ";
    cout << arr[i];
  }
  cout << endl;
  return;
}

void dfs(int ind, int val, int n)
{
  if(val > n) return;
  for(int i = val; i <= n; i++)
  {
    arr[ind] = i;
    printf_one_result(ind);
    dfs(ind + 1, i + 1, n);
  }
}
int main()
{
  int n;
  cin >> n;
  dfs(0, 1, n);
  return 0;
}
